# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=uglify-js
pkgver=3.14.1
pkgrel=1
pkgdesc="JavaScript parser, mangler/compressor and beautifier toolkit"
url="https://lisperator.net/uglifyjs"
# riscv64 blocked by nodejs
arch="noarch !riscv64"
license="BSD-2-Clause"
depends="nodejs"
makedepends="npm"
source="https://registry.npmjs.org/uglify-js/-/uglify-js-$pkgver.tgz"
options="!check"
builddir="$srcdir/package"

unpack() {
	# skipping unpacking, installing archive directly
	verify
}

package() {
	npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/uglify-js-$pkgver.tgz"
	find "$pkgdir/usr/lib/node_modules/root" -delete
	chown -R root: "$pkgdir" # npm installs as build user
}

sha512sums="
2614b7866715697969ff14a8dcf298e51d09a8ab39337215f9ec5d2c75bdf6a2af2a2bcf3b867ca9b7a3ea6b5ed7b48e3ea00e54c8edfd71a059a727152cccde  uglify-js-3.14.1.tgz
"
